package com.cheneyjoo.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class Repository {
    /**
     * 获取仓库地址
     * @return
     */
    public static File getRepositoryFile(String tableName) throws IOException {
        File file = new File("");
        String diskPath = file.getCanonicalPath().substring(0, file.getCanonicalPath().indexOf("\\") + 1);
        File repository = new File(diskPath + "Repository\\"+tableName);
        if (!repository.exists()) {
            repository.getParentFile().mkdirs();
            repository.createNewFile();
        }
        return repository;
    }
}
